#ifndef _DEBRUIJN_GRAPH_BUILDER_H_
#define _DEBRUIJN_GRAPH_BUILDER_H_
#include "FastaReader.h"
#include "DeBruijnGraph.h"
#include "ReadInputFacts.h"
#include "KmerCounter.h"
#include "map_utility.h"
#include <functional>

/**
 * 	Debruijn graph builder. Build debruijn graph from given reads.
 *
 * @author	Tao Yu
 * @date	2011/3/23
 */
class DeBruijnGraphBuilder
{
private:
	DeBruijnGraph* m_graph; //< debuijn graph
	ReadInputFacts* m_readFacts; //< contains all reads
	bool m_inward; //< if the reads are paired inward
public:
	/**
	 * 	Constructor. Read reads from reader and use statistics to filter and correct kmers.
	 * 	The kmers are then built to be an debuijin graph.
	 *		This will call new, so do not forget to delete the debuijn graph and the reader set after use.
	 *
	 * @author	Tao Yu
	 * @date	2011/3/7
	 *
	 * @param [in,out]	reader	  	The reader.
	 * @param [in,out]	statistics	The statistics.
	 */
	DeBruijnGraphBuilder(AbstractReader& reader, bool inward, int kmerThreshold); // must be reference or you will get error c2248 if fstream object exists

	/**
	 * 	Gets the debruijn graph.
	 *
	 * @author	Tao Yu
	 * @date	2011/3/23
	 *
	 * @return	The debruijn graph built.
	 */
	DeBruijnGraph* getDeBruijnGraph();

	/**
	 * 	Gets the read set.
	 *
	 * @author	Tao Yu
	 * @date	2011/3/23
	 *
	 * @return	The read set.
	 */
	ReadInputFacts* getReadFacts();
	~DeBruijnGraphBuilder();
};

#endif
